public class TestDemo {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("前序遍历");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("中序遍历");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("后序遍历");
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("结点的个数："+binaryTree.size(root));
        binaryTree.size2(root);
        System.out.println("结点的个数2："+BinaryTree.nodeSize);
        System.out.println("=================================");
        System.out.println("叶子结点个数："+binaryTree.getLeafNodeCount(root));
        binaryTree.getLeafNodeCount2(root);
        System.out.println("叶子结点个数2："+BinaryTree.leafSize);
        System.out.println("第k层结点的个数："+binaryTree.getKLevelNodeCount(root,4));
        System.out.println("高度："+binaryTree.getHeight(root));
        System.out.println("查找结点："+binaryTree.find(root,'E').val);
    }
}
